import factory from '@adonisjs/lucid/factories'
import Dict from '#models/dict'

export const DictFactory = factory
  .define(Dict, async ({ faker }) => {
    return {
      name: faker.word.sample({
        length: {
          min: 5,
          max: 10,
        },
      }),
      className: faker.helpers.arrayElement(['dept', 'role', 'job', 'payment']),
      sort: faker.number.int({ min: 1, max: 10 }),
      code: faker.string.nanoid(),
    }
  })
  .build()
